fix instruction address range limitation
authorJiafei Pan <[email protected]>
Tue, 27 Mar 2018 15:00:55 +0000 (23:00 +0800)
committerJiafei Pan <[email protected]>
Sat, 7 Apr 2018 02:13:59 +0000 (10:13 +0800)
For the adr instruction, it require the label's offset from the
address of this instruction must be in the range +/-1MB. If the
option "BL2_IN_XIP_MEM" is set to '1', in some cases, BL2's RW
memory will not in the range of +/-1MB from BL2's RO memory region.
so we need to use ldr instruction to cover this case.

Signed-off-by: Jiafei Pan <[email protected]>
include/common/aarch64/el3_common_macros.S

index e85249c418c6576e6f72d4766f461a866b90ccf0..d5f527aa3b589b475b74bdc0eed92be940296382 100644 (file)
                 * an earlier boot loader stage.
                 * -------------------------------------------------------------
                 */
-               adr     x0, __RW_START__
-               adr     x1, __RW_END__
+               ldr     x0, =__RW_START__
+               ldr     x1, =__RW_END__
                sub     x1, x1, x0
                bl      inv_dcache_range
 #endif